package com.jar.exercise.设计模式.visitor模式.visitor;

import com.jar.exercise.设计模式.visitor模式.user.Student;
import com.jar.exercise.设计模式.visitor模式.user.Teacher;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 校长类
 */
public class Principal implements Visitor{
    private final Logger logger = LoggerFactory.getLogger(Principal.class);


    @Override
    public void visitor(Teacher teacher) {
        logger.info("校长看到的老师的升学率：{}",teacher.enrollmentRate());
    }

    @Override
    public void visitor(Student student) {
        logger.info("校长看学生的信息：姓名：{},班级：{}",student.getName(),student.getClassName());
    }
}
